/*
 * @Author: 许伟茂
 * @Description: 动态组件
 * @Date: 2021-02-24 10:28:13
 */
import React from 'react';
import loadable from '@loadable/component';

interface IProps {
  name: string;
  data?: object
}

function DyComponent(props: IProps) {
  const LoadableComponent = loadable(() => import(`./${props.name}`));
  return (
    <LoadableComponent data={props.data} />
  );
}

export default DyComponent;